package org.halk;

import org.apache.dubbo.config.annotation.DubboReference;
import org.halk.dubboapi.service.DemoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@SpringBootApplication
public class ConsumerApplication {

    private final Logger log = LoggerFactory.getLogger(ConsumerApplication.class);

    @DubboReference
    private DemoService DemoService;

    public static void main(String[] args) {
        SpringApplication.run(ConsumerApplication.class);
    }

    @Bean
    public ApplicationRunner runner() {
        return args -> log.info(DemoService.sayHello("server  provider"));
    }
}
